<template>
    <div>
        <input type="checkbox" v-for="(value,index) in 5" :key="index" ref="dui">
        <button @click="fn">
            全选
        </button>
    </div>
</template>
<script>
export default {
    data(){
        return{
            name:""
        }
    },
    mounted(){
        this.name = this.$refs.dui
    },
    methods:{
        fn(){
            console.log(this.name.value);
        }
    }
}
</script>